package myadmin.jtthink.com.MyAspects;


import myadmin.jtthink.com.Models.ResultModel;
import myadmin.jtthink.com.MyHelper.ServiceHelper;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.aspectj.lang.annotation.Pointcut;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Aspect
@Component
public class GlobalAspect {
    @Autowired
    ServiceHelper serviceHelper;
    @Pointcut("execution(public * myadmin.jtthink.com.MyHttp.MyHttp.*(..))")
    public void web(){}
    @Around("web()")
    public Object around(ProceedingJoinPoint point) throws Throwable {
        Object[] args= point.getArgs();
        Object result=this.serviceHelper.invoke(args);
       return new ResultModel("success",result);
    }

}
